package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SqlServiceMapper;
import com.ruoyi.system.domain.SqlService;
import com.ruoyi.system.service.ISqlServiceService;
import com.ruoyi.common.core.text.Convert;

/**
 * SQL服务信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-30
 */
@Service
public class SqlServiceServiceImpl implements ISqlServiceService 
{
    @Autowired
    private SqlServiceMapper sqlServiceMapper;

    /**
     * 查询SQL服务信息
     * 
     * @param id SQL服务信息主键
     * @return SQL服务信息
     */
    @Override
    public SqlService selectSqlServiceById(Long id)
    {
        return sqlServiceMapper.selectSqlServiceById(id);
    }

    /**
     * 查询SQL服务信息列表
     * 
     * @param sqlService SQL服务信息
     * @return SQL服务信息
     */
    @Override
    public List<SqlService> selectSqlServiceList(SqlService sqlService)
    {
        return sqlServiceMapper.selectSqlServiceList(sqlService);
    }

    /**
     * 新增SQL服务信息
     * 
     * @param sqlService SQL服务信息
     * @return 结果
     */
    @Override
    public int insertSqlService(SqlService sqlService)
    {
        sqlService.setCreateTime(DateUtils.getNowDate());
        return sqlServiceMapper.insertSqlService(sqlService);
    }

    /**
     * 修改SQL服务信息
     * 
     * @param sqlService SQL服务信息
     * @return 结果
     */
    @Override
    public int updateSqlService(SqlService sqlService)
    {
        return sqlServiceMapper.updateSqlService(sqlService);
    }

    /**
     * 批量删除SQL服务信息
     * 
     * @param ids 需要删除的SQL服务信息主键
     * @return 结果
     */
    @Override
    public int deleteSqlServiceByIds(String ids)
    {
        return sqlServiceMapper.deleteSqlServiceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除SQL服务信息信息
     * 
     * @param id SQL服务信息主键
     * @return 结果
     */
    @Override
    public int deleteSqlServiceById(Long id)
    {
        return sqlServiceMapper.deleteSqlServiceById(id);
    }
}
